<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>7_文本溢出替换为省略号</title>
    <style>
        div{
            background-color: #ff0;
            /*必须设置所在区域的大小*/
            width: 200px;
            /*以下三句为组合代码，缺一不可*/
            white-space: nowrap;/*不允许换行*/
            overflow: hidden;/*溢出部分隐藏*/
            text-overflow: ellipsis;/*超出的文字替换为省略号*/
        }
    </style>
</head>
<body>
    <div>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid dolorem, enim eveniet ex excepturi fugiat illo ipsum iure laboriosam magni molestiae quod recusandae, reiciendis saepe, voluptatem! Culpa sapiente sit voluptate.
    </div>
</body>
</html>